package io.yx

import androidx.compose.desktop.ui.tooling.preview.Preview
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application

@Composable
@Preview
fun App() {
    MaterialTheme {
        Box(
            modifier = Modifier
                .fillMaxSize() // 让Box占满整个屏幕
                .background(color = MaterialTheme.colors.background), // 设置背景色
            contentAlignment = Alignment.Center // 设置内容居中
        ) {
            Surface(
//                shape = RoundedCornerShape(8.dp),
                shape = CircleShape,
                elevation = 10.dp,
                modifier = Modifier
                    .width(300.dp)
                    .height(300.dp)
            ) {
                Text(text = "")
            }
        }

    }
}

fun main() = application {
    Window(onCloseRequest = ::exitApplication, title = "摸鱼时间", icon = painterResource("touchFish.png")) {
        App()
    }
}
